package quartz;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.Scheduler;

/**
 * Created by cdxuhongya on 2016/10/11.
 */
public class QuartzJob implements Job{


    public void execute(JobExecutionContext context) throws JobExecutionException {
       String name =  context.getJobDetail().getJobDataMap().getString("name");


        for (int i = 0; i < 10; i++) {
            System.out.println("job is running"  + i + "name:" + name);
            try {
                Thread.sleep(100);
            }catch (Exception e){
                System.out.println("error");
            }
        }

    }
}
